package 枚举;

import java.util.Arrays;
import java.util.concurrent.Semaphore;

public class EnumDemo {
    public static void main(String[] args) {
        //枚举无法创建对象，只能采用本身创建好的对象
        Season s =Season.SPRING;//获取春天对象
        System.out.println(s.getSeasonName());
        switch (s){
            case AUTUMN:

        }

        Season[] seasons =Season.values();//该方法可以获取所有对象，返回一个数组
        System.out.println(Arrays.toString(seasons));


        Season s1 =Season.valueOf("SPRING");//同上，也是在获取春天对象
        System.out.println(s1.getSeasonName());
    }
}
